package ru.kipriz.todoly.api.entities;

import java.util.List;

/**
 * <p>Copyright: Copyright (c) 2010</p>
 *
 * @author Andrey Volkov
 *         <br/>Date: 12/24/10
 */
public class FilterObject implements Entity
{
    private long id;
    public String content;
    public int itemsCount;
    public int icon;
    public int itemType;
    public List<FilterObject> children;

    public long getId()
    {
        return id;
    }

    public void setId(long id)
    {
        this.id = id;
    }

    public String getContent()
    {
        return content;
    }

    public void setContent(String content)
    {
        this.content = content;
    }

    public int getItemsCount()
    {
        return itemsCount;
    }

    public void setItemsCount(int itemsCount)
    {
        this.itemsCount = itemsCount;
    }

    public int getIcon()
    {
        return icon;
    }

    public void setIcon(int icon)
    {
        this.icon = icon;
    }

    public int getItemType()
    {
        return itemType;
    }

    public void setItemType(int itemType)
    {
        this.itemType = itemType;
    }

    public List<FilterObject> getChildren()
    {
        return children;
    }

    public void setChildren(List<FilterObject> children)
    {
        this.children = children;
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o)
        {
            return true;
        }
        if (!(o instanceof FilterObject))
        {
            return false;
        }

        FilterObject that = (FilterObject) o;

        if (icon != that.icon)
        {
            return false;
        }
        if (id != that.id)
        {
            return false;
        }
        if (itemType != that.itemType)
        {
            return false;
        }
        if (itemsCount != that.itemsCount)
        {
            return false;
        }
        if (!content.equals(that.content))
        {
            return false;
        }

        return true;
    }

    @Override
    public Object clone() throws CloneNotSupportedException
    {
        return super.clone();
    }

    @Override
    public int hashCode()
    {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + content.hashCode();
        result = 31 * result + itemsCount;
        result = 31 * result + icon;
        result = 31 * result + itemType;
        return result;
    }
}
